package com.heima.utils.threadlocal;

import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author 胡慧
 * @title: UserThreadLocalUtils
 * @projectName heima-leadnews
 * @description: app端用户登录线程
 * @date 2021/3/32:25
 */
public class AppThreadLocalUtils {
    private final static ThreadLocal<ApUser> userThreadLocal=new ThreadLocal<>();
    //    设置当前线程中的用户
    public static void setUser(ApUser apUser){
        userThreadLocal.set(apUser);
    }

    /**
     * 获取线程中的用户
     * @return
     */
    public static ApUser getUser(){
        return userThreadLocal.get();
    }
}
